package com.egame.ewidget.model;

public enum ContentType {

	UNKNOWN(-1), //
	WIFI(0), //
	MOBILE_DATA(1), //
	BRIGHTNESS_MODE(2), //
	RINGER_MODE(3), //
	FLASH_TORCH(4), //
	CLEAR_MEM(5); //

	private static final int CONTENT_COUNT = 14;

	private int mContentId;

	private ContentType(int contentId) {
		this.mContentId = contentId;
	}

	/**
	 * Retrieves constant that represents one of supported content type.
	 * 
	 * @return The {@link Integer} representation of the specified content type.
	 */
	public int getContentId() {
		return mContentId;
	}

	public static ContentType getContentType(int contentId) {
		switch (contentId) {
		case 0:
			return ContentType.WIFI;
		case 1:
			return ContentType.MOBILE_DATA;
		case 2:
			return ContentType.BRIGHTNESS_MODE;
		case 3:
			return ContentType.RINGER_MODE;
		case 4:
			return ContentType.FLASH_TORCH;
		case 5:
			return ContentType.CLEAR_MEM;
		default:
			return ContentType.UNKNOWN;
		}
	}

	public static int getContentCount() {
		return CONTENT_COUNT;
	}

	@Override
	public String toString() {
		switch (mContentId) {
		case 0:
			return "[WiFi]";
		case 1:
			return "[Mobile Data]";
		case 2:
			return "[Brightness mode]";
		case 3:
			return "[Ringer mode]";
		case 4:
			return "[Flash Torch]";
		case -1:
			return "[Unknown]";
		default:
			return super.toString();
		}
	}

}